package com.zc.angelica.controller;

import com.zc.angelica.entity.ButtonInfo;
import com.zc.angelica.entity.ResponseData;
import com.zc.angelica.service.ButtonInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/buttonInfo")
public class ButtonInfoController {

    @Autowired
    private ButtonInfoService buttonService;

    @PostMapping("/addButton")
    public ResponseData addButton(@RequestBody ButtonInfo buttonInfo) {
        return buttonService.addButton(buttonInfo);
    }

    @GetMapping("/deleteButton")
    public ResponseData deleteButton(Long id) {
        return buttonService.deleteButton(id);
    }

    @GetMapping("/updateButton")
    public ResponseData updateButton(ButtonInfo buttonInfo) {
        return buttonService.updateButton(buttonInfo);
    }

    @GetMapping("/list")
    public ResponseData list() {
        return ResponseData.success(buttonService.list());
    }


}
